<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common_head(title,links,scripts)">
    <meta charset="UTF-8">
    <title>影院售票票</title>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">

    <!-- 引入公共的第三方库 -->
    <link href="/libs/bootstrap-fonts/bootstrap-fonts.css" rel="stylesheet"/>
    <link href="/libs/bootstrap5/bootstrap.min.css" rel="stylesheet"/>
    <script type="text/javascript" src="/libs/bootstrap5/bootstrap.min.js"></script>

    <!-- 引入公共的样式表和JS -->
    <link href="/css/common/base.css" rel="stylesheet"/>
    <link href="/css/common/variable.css" rel="stylesheet"/>
    <link href="/css/common/ticket-common.css" rel="stylesheet"/>
    <script src="/js/common/ticket-common.js" type="text/javascript"></script>

    <!-- 引入界面中自定义的link 和script标签 -->
    <th:block th:replace="${links}"/>
    <th:block th:replace="${scripts}"/>


</head>

<body>
<!--导航条-->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark " th:fragment="ticket-header">
    <a class="navbar-brand" href="#">Navbar</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <li class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav">
        <div class="menu-area">
            <a href="/"
               th:class="'menu-item menu-item-selected-' + (${#httpServletRequest.requestURI} == '/')">首页</a>
            <a href="/search"
               th:class="'menu-item menu-item-selected-' + (${#httpServletRequest.requestURI} == '/search')">电影 </a>
            <a href="/cinema"
               th:class="'menu-item menu-item-selected-' + (${#httpServletRequest.requestURI} == '/cinema')">影院</a>
        </div>
        </ul>
    </li>



        <form class="form-inline my-2 my-lg-0" action="search">
            <input class="form-control mr-sm-2" type="search" placeholder="请输入要搜索的电影名称" name="keyword"
                   th:value="${keyword}" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
        </form>

        <div class="nav-item" th:if="${session.USER_INFO} == null">
            <button th:onclick="location='/login'" type="button" class="btn btn-outline-success btn-sm login-btn">登录
            </button>
            <button th:onclick="location='/register'" type="button" class="btn btn-outline-primary btn-sm register-btn">
                立即注册
            </button>
        </div>

        <div class="nav-item dropdown" th:if="${session.USER_INFO} != null">
            <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-expanded="false">
                [[${session.USER_INFO.name}]]
            </a>
            <!--模态框-->
            <!--<div class="dropdown-menu">
                <a class="dropdown-item" data-toggle="modal" data-target="#logoutConfirmModal" href="#">退出登录</a>
            </div>-->

            <div class="dropdown-menu">
                <a class="dropdown-item" href="/logout">退出登录</a>
            </div>
        </div>

        <!--<div class="modal fade" id=="logoutConfirmModal">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                         <h5 class="modal-title">退出登录 title</h5>
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                            </button>
                   </div>
                    <div class="modal-body">
                        您确认要退出当前已经登录的用户吗？
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                        <button th:onclick="location='/logout'" type="button" class="btn btn-primary">退出登录</button>
                    </div>
                </div>
            </div>
        </div>-->

</nav>



<div class="mall-footer" th:fragment="mall-footer">
    copyright 2023 NeuMall 大连东软信息学院
</div>
</body>
</html>